package com.atlin.project.service;

import com.atlin.project.model.domain.User;
import com.atlin.project.model.vo.UserVO;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author atlin
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2023-10-21 22:02:56
*/
public interface UserService extends IService<User> {


    /**
     * 用户注册
     *
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @param planetCode 星球编号
     * @return 新用户 id
     */
    Long userRegister(String userAccount, String userPassword, String checkPassword, String planetCode);

    /**
     * 用户登录
     *
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param request 请求
     * @return 脱敏后的用户信息
     */
    UserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);


    /**
     * 用户脱敏
     *
     * @param originUser
     * @return
     */
    UserVO getSafetyUser(User originUser);
    /**
     *用户注销
     *
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);

    /**
     * 修改用户信息
     *
     * @param user
     * @return
     */
    Boolean userUpdate(User user);
    

    User getLoginUser(HttpServletRequest request);

    boolean isAdmin(HttpServletRequest request);
}
